home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13223 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  841 b 

  1. Path: ix.netcom.com!news
  2. From: jlilley@ix.netcom.com (John Lilley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Operators <<= and >>=
  5. Date: 24 Mar 1996 05:37:52 GMT
  6. Organization: Netcom
  7. Message-ID: <4j2n3g$j4l@dfw-ixnews4.ix.netcom.com>
  8. References: <4iva5m$4q5@access4.digex.net>
  9. NNTP-Posting-Host: den-co25-11.ix.netcom.com
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-NETCOM-Date: Sat Mar 23 11:37:52 PM CST 1996
  13. X-Newsreader: WinVN 0.99.7
  14.  
  15. In article <4iva5m$4q5@access4.digex.net>, car@access4.digex.net says...
  16. >When / why would one overload the operators <<= and >>=  ?
  17.  
  18. If you overload operators '<<' and/or '>>' to mean something
  19. that returns a value (analogous to the built-in meaning),
  20. then you should define '<<=' and/or '>>=' so that:
  21.  
  22.         a = a << b;
  23.  
  24. produces the same result as
  25.  
  26.         a <<= b;
  27.  
  28. john lilley
  29.  
  30.